﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MyProfile.aspx.cs" Inherits="NWBA_Public.MyProfile" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageBody" runat="server">
    <div>
        <asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource1">
            <EditItemTemplate>
                CustomerID:
                <asp:Label ID="CustomerIDTextBox" runat="server" Text='<%# Bind("CustomerID") %>' />
                <br />
                CustomerName:
                <asp:TextBox ID="CustomerNameTextBox" runat="server" Text='<%# Bind("CustomerName") %>' />
                <br />
                TFN:
                <asp:TextBox ID="TFNTextBox" runat="server" Text='<%# Bind("TFN") %>' />
                <br />
                Address:
                <asp:TextBox ID="AddressTextBox" runat="server" Text='<%# Bind("Address") %>' />
                <br />
                City:
                <asp:TextBox ID="CityTextBox" runat="server" Text='<%# Bind("City") %>' />
                <br />
                State:
                <asp:TextBox ID="StateTextBox" runat="server" Text='<%# Bind("State") %>' />
                <br />
                PostCode:
                <asp:TextBox ID="PostCodeTextBox" runat="server" Text='<%# Bind("PostCode") %>' />
                <br />
                Phone:
                <asp:TextBox ID="PhoneTextBox" runat="server" Text='<%# Bind("Phone") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                CustomerID:
                <asp:TextBox ID="CustomerIDTextBox" runat="server" ReadOnly="true" Text='<%# Eval("CustomerID") %>' />
                <br />
                CustomerName:
                <asp:TextBox ID="CustomerNameTextBox" runat="server" Text='<%# Bind("CustomerName") %>' />
                <br />
                TFN:
                <asp:TextBox ID="TFNTextBox" runat="server" Text='<%# Bind("TFN") %>' />
                <br />
                Address:
                <asp:TextBox ID="AddressTextBox" runat="server" Text='<%# Bind("Address") %>' />
                <br />
                City:
                <asp:TextBox ID="CityTextBox" runat="server" Text='<%# Bind("City") %>' />
                <br />
                State:
                <asp:TextBox ID="StateTextBox" runat="server" Text='<%# Bind("State") %>' />
                <br />
                PostCode:
                <asp:TextBox ID="PostCodeTextBox" runat="server" Text='<%# Bind("PostCode") %>' />
                <br />
                Phone:
                <asp:TextBox ID="PhoneTextBox" runat="server" Text='<%# Bind("Phone") %>' />
                <br />
                Logins:
                <asp:TextBox ID="LoginsTextBox" runat="server" Text='<%# Bind("Logins") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
                CustomerID:
                <asp:Label ID="CustomerIDLabel" runat="server" Text='<%# Bind("CustomerID") %>' />
                <br />
                CustomerName:
                <asp:Label ID="CustomerNameLabel" runat="server" Text='<%# Bind("CustomerName") %>' />
                <br />
                TFN:
                <asp:Label ID="TFNLabel" runat="server" Text='<%# Bind("TFN") %>' />
                <br />
                Address:
                <asp:Label ID="AddressLabel" runat="server" Text='<%# Bind("Address") %>' />
                <br />
                City:
                <asp:Label ID="CityLabel" runat="server" Text='<%# Bind("City") %>' />
                <br />
                State:
                <asp:Label ID="StateLabel" runat="server" Text='<%# Bind("State") %>' />
                <br />
                PostCode:
                <asp:Label ID="PostCodeLabel" runat="server" Text='<%# Bind("PostCode") %>' />
                <br />
                Phone:
                <asp:Label ID="PhoneLabel" runat="server" Text='<%# Bind("Phone") %>' />
                <br />
                <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
            </ItemTemplate>
        </asp:FormView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="Select" TypeName="NWBA_Public.CustomerRepository" UpdateMethod="Update">
            <SelectParameters>
                <asp:SessionParameter Name="id" SessionField="ID" Type="Int32" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="CustomerID" Type="Int32" />
                <asp:Parameter Name="CustomerName" Type="String" />
                <asp:Parameter Name="TFN" Type="String" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="city" Type="String" />
                <asp:Parameter Name="state" Type="String" />
                <asp:Parameter Name="postCode" Type="String" />
                <asp:Parameter Name="phone" Type="String" />
            </UpdateParameters>
        </asp:ObjectDataSource>
        <%-- form view that provides the dispaly and editing of a person's profile --%>
    </div>
    <div>
        <p>Change your password</p>
        <div>

            <asp:Label ID="lblPass1" runat="server" Text="NewPassword"></asp:Label>
            <asp:TextBox ID="tbPass1" runat="server" TextMode="Password"></asp:TextBox>

            <br />
            <asp:Label ID="lblPass2" runat="server" Text="ComfrimYourPassword"></asp:Label>
            <asp:TextBox ID="tbPass2" runat="server" TextMode="Password"></asp:TextBox>
            <asp:CompareValidator runat="server" ID="PasswordValidator" Text="password does not match" ControlToCompare="tbPass1" ControlToValidate="tbPass2" ValidationGroup="password"></asp:CompareValidator>
            <br />
            <asp:Button ID="BtnChangePassword" runat="server" Text="Change" OnClick="BtnChangePassword_Click" ValidationGroup="password" />

        </div>
    </div>
</asp:Content>
